USE [GD1C2012]
GO

/****** Object:  Table [SUPERACIDOS].[Auto]    Script Date: 06/11/2012 09:25:20 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [SUPERACIDOS].[Auto](
	[Auto_Id] [int] IDENTITY(1,1) NOT NULL,
	[Auto_ModeloId] [int] NOT NULL,
	[Auto_Patente] [varchar](10) NULL,
	[Auto_Licencia] [varchar](26) NULL,
	[Auto_Rodado] [varchar](10) NULL,
	[Auto_RelojId] [int] NOT NULL,
	[Auto_Habilitado] [bit] NOT NULL,
 CONSTRAINT [PK_Auto] PRIMARY KEY CLUSTERED 
(
	[Auto_Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [SUPERACIDOS].[Auto]  WITH CHECK ADD  CONSTRAINT [FK_Auto_Modelo_Auto] FOREIGN KEY([Auto_ModeloId])
REFERENCES [SUPERACIDOS].[Modelo_Auto] ([MoAu_Id])
GO

ALTER TABLE [SUPERACIDOS].[Auto] CHECK CONSTRAINT [FK_Auto_Modelo_Auto]
GO

ALTER TABLE [SUPERACIDOS].[Auto]  WITH CHECK ADD  CONSTRAINT [FK_Auto_Reloj] FOREIGN KEY([Auto_RelojId])
REFERENCES [SUPERACIDOS].[Reloj] ([Reloj_Id])
GO

ALTER TABLE [SUPERACIDOS].[Auto] CHECK CONSTRAINT [FK_Auto_Reloj]
GO

ALTER TABLE [SUPERACIDOS].[Auto] ADD  CONSTRAINT [DF_Auto_Habilitado]  DEFAULT ((1)) FOR [Auto_Habilitado]
GO

